<%--
  Created by IntelliJ IDEA.
  User: cc chen
  Date: 2018/8/3
  Time: 10:39
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <title>搜索(豆瓣酱)</title>
    <meta charset="utf-8">
    <%--<script type="text/javascript" src='jquery-1.9.1.js'></script>--%>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/static/css/loadingStyle.css">

    <!--自定义的样式-->
    <style>
        .pic{
            float: left;
            width: 120px;
            height: 184px;
            margin-right: 20px;
            border: #000 solid 1px;
            overflow: hidden;
        }
        .pic a {
            position: relative;
            display: block;
            overflow: hidden;
            width: 100%;
            height: 100%;
            box-shadow: 0 1px 6px rgba(0,0,0,.35), 0 0 5px #f9f2e9 inset;
        }
        .pic a img{
            position: relative;
            display: block;
            overflow: hidden;
            width: 100%;
            height: 100%;
            box-shadow: 0 1px 6px rgba(0,0,0,.35), 0 0 5px #f9f2e9 inset;
            cursor: pointer;
            transition: all 0.6s ease-out;
        }
        .pic a img:hover{
            transform: scale(1.1);
        }


        .subject-item, .site-item {
            overflow: hidden;
            zoom: 1;
            border-top: 1px dashed #ddd;
            padding: 20px 0 10px;
        }
        .subject-item .info, .site-item .info {
            overflow: hidden;
            zoom: 1;
            color: #666;
        }
        .subject-item .pic, .site-item .pic {
            float: left;
            margin-right: 20px;
        }
        .subject-item .info p{
            margin-top: 6px;
            margin-bottom: 6px;
            font-size: 13px;
        }
        .subject-item .info p em{
            margin: 1px 5px 0;
            color: #a5a5a5;
        }
        .subject-item .info .ft {
            margin-top: 10px;
            position: relative;
            min-height: 19px;
            _height: 19px;
        }
        h2 {
            font: 15px Arial, Helvetica, sans-serif;
            color: #1f0404;
            margin: 0 0 12px 0;
            line-height: 150%;
        }
        #content{
            width: 1000px;
            margin-left: 100px;
        }
        #bookList{
            width: 675px;
            float: left;
        }
    </style>
</head>
<body>
<%
    String sessionID =session.getId();
%>
<font id="sessionID" hidden="hidden"><%=sessionID%></font>
<div class="container">
    <div class="row clearfix" style="background-color: rgba(0,0,0,0.7)">
        <div class="col-md-11 column" style="padding-top: 20px">
            <form action="searchBookeditAction" id="form">
                <div class="dropdown" style="vertical-align: middle">
                    <a style="color: white;font-size: x-large">搜索</a>

                    <input type="text" id="searchContent" name="searchContent" placeholder="请输入书名">
                    <button class="btn btn-link" onclick="myFunc()">
                        <span class="glyphicon glyphicon-search" style="color: white"></span>
                        <span style="color:white" >Search</span></button>
                </div>
            </form>
        </div>
        <!--返回主页按钮-->
        <div class="col-md-1 column">
            <h3><a href="homeAdminAction" style="color: white">返回</a></h3>
        </div>

    </div>
    <div id="content">
        <div id="bookList">
            <h2>已搜索到${searchSize}条记录</h2>

            <div><span style="color: red">${berror}</span></div>
            <c:forEach items="${bookInfoList}" var="book">
                <form action="updateBookInfoAction" method="post">
                    <div class="subject-item">
                        <div class="pic">
                                <%--<a target="_blank" href="bookDetailAction?book_id=${book.bid}">--%>
                            <a><img alt="140x140" src="${book.burl}"  style="height:184px;width:120px" /></a>
                                <%--</a>--%>
                        </div>
                        <div class="info">
                            <input name="bid" id="bid" value="${book.bid}" hidden="hidden">
                            书名：<input name="bname" id="bname" style="margin-bottom: 3px" value="${book.bname}"></input>
                            <p>
                                作者：<input type="text" name="bauthor" id="bauthor" class="author" value="${book.bauthor}"></input>
                                <em>|</em>
                                价格<input type="text" pattern="[0-9]+.?[0-9]{0,2}"  class="price" name="bprice" id="bprice" value="${book.bprice}"></input>
                            </p>
                            <div class="star">评分: <input type="text" pattern="[0-9]?.[0-9]"  name="bscore" id="bscore" value="${book.bscore}"></div>
                            图片路径<input type="text" class="form-control" name="burl" id="burl" value="${book.burl}">
                            <div style="margin-top: 10px">
                                简介：
                                <c:choose>
                                    <c:when test="${fn:length(book.btext) > 30}">
                                        <%--<p>${contentDes}</p>--%>
                                        <textarea name="btext" id="btext" cols="80" rows="5">${fn:substring(book.btext,0,100)}</textarea>
                                        <a href="#"  style="cursor:default;text-decoration:none;color:#0000ff;" title="${book.btext}">...</a>
                                    </c:when>
                                    <c:otherwise>
                                        <textarea name="btext" id="btext" cols="50" rows="5">${book.btext}</textarea>
                                    </c:otherwise>
                                </c:choose>
                            </div>
                            <div class="ft">
                            <span>
                                库存：<input type="number" name="bnum" id="bnum" value="${book.bnum}">
                            </span>
                                <button class="btn btn-default" style="background-color: #32aacc;color: white;border-color: #32aacc">修改</button>
                            </div>
                        </div>
                    </div>
                </form>

            </c:forEach>
        </div>
    </div>
</div>


</body>
</html>
